public class binarySearchGBD {
    //改动版
    public static int binarySearchGDB(int[] a, int target) {
        int i = 0;
        int j = a.length;//改动1
        while (i < j) {//改动2
            int m = (i + j) >>> 1;
            if (target < a[m]) {
                j = m;//改动3
            } else if (target > a[m]) {
                i = m + 1;
            } else {
                return m;
            }
        }
        return -1;
    }
}
